Ext.define('ES.controller.component.CompDetailController',{
	extend:'Ext.app.Controller',
	 views: [
        'componentDetail.CompDetail'
    ],
    refs: [
        {
        	ref:'compDetailRef',
        	selector:'compdetail'
        }
    ],
    requires:['ES.store.component.CompCategoryStore','ES.view.componentDetail.CompDetail','ES.view.uploadComp.UploadComp'],
    stores:['component.CompCategoryStore'],
	init:function(){
		this.control({
			'compdetail':{
				render:this.compDetailRendered
			}
		});
	},
    compDetailRendered: function(dComp) {
		dComp.loadTreeFun(this.getStore('component.CompCategoryStore'));
		dComp.down('button[action=upload]').on('click', this.detailUploadButtonClick)
    },
    detailUploadButtonClick:function(){
    	Ext.create('ES.view.uploadComp.UploadComp').show();
    }
});